import { IPSSubSysServiceAPI } from './ipssub-sys-service-api';
import { IPSSubSysServiceAPIDE } from './ipssub-sys-service-apide';
import { IPSSubSysServiceAPIDERS } from './ipssub-sys-service-apiders';
import { PSModelObjectImpl } from '../psmodel-object-impl';

export class PSSubSysServiceAPIDERSImpl extends PSModelObjectImpl implements IPSSubSysServiceAPIDERS {
  get codeName(): string {
    return this.M.codeName;
  }

  get codeName2(): string {
    return this.M.codeName2;
  }

  get dynaModelFilePath(): string {
    return this.M.dynaModelFilePath;
  }

  protected majorpssubsysserviceapide: IPSSubSysServiceAPIDE | null = null;

  getMajorPSSubSysServiceAPIDE(): IPSSubSysServiceAPIDE | null {
    if (this.majorpssubsysserviceapide != null) return this.majorpssubsysserviceapide;
    const value = this.M.getMajorPSSubSysServiceAPIDE;
    if (value == null) {
      return null;
    }
    const ipssubsysserviceapi = this.getParentPSModelObject('service.IPSSubSysServiceAPI') as IPSSubSysServiceAPI;
    if (ipssubsysserviceapi != null) {
      this.majorpssubsysserviceapide = ipssubsysserviceapi.findPSSubSysServiceAPIDE(value);
    }
    return this.majorpssubsysserviceapide;
  }

  get majorPSSubSysServiceAPIDE(): IPSSubSysServiceAPIDE | null {
    return this.getMajorPSSubSysServiceAPIDE();
  }

  getMajorPSSubSysServiceAPIDEMust(): IPSSubSysServiceAPIDE {
    const value = this.getMajorPSSubSysServiceAPIDE();
    if (value == null) {
      throw new Error('未指定主接口实体');
    }
    return value;
  }

  get masterOrder(): number {
    return this.M.masterOrder != null ? this.M.masterOrder : -1;
  }

  get memo(): string {
    return this.M.memo;
  }

  protected minorpssubsysserviceapide: IPSSubSysServiceAPIDE | null = null;

  getMinorPSSubSysServiceAPIDE(): IPSSubSysServiceAPIDE | null {
    if (this.minorpssubsysserviceapide != null) return this.minorpssubsysserviceapide;
    const value = this.M.getMinorPSSubSysServiceAPIDE;
    if (value == null) {
      return null;
    }
    const ipssubsysserviceapi = this.getParentPSModelObject('service.IPSSubSysServiceAPI') as IPSSubSysServiceAPI;
    if (ipssubsysserviceapi != null) {
      this.minorpssubsysserviceapide = ipssubsysserviceapi.findPSSubSysServiceAPIDE(value);
    }
    return this.minorpssubsysserviceapide;
  }

  get minorPSSubSysServiceAPIDE(): IPSSubSysServiceAPIDE | null {
    return this.getMinorPSSubSysServiceAPIDE();
  }

  getMinorPSSubSysServiceAPIDEMust(): IPSSubSysServiceAPIDE {
    const value = this.getMinorPSSubSysServiceAPIDE();
    if (value == null) {
      throw new Error('未指定从接口实体');
    }
    return value;
  }

  get name(): string {
    return this.M.name;
  }

  get parentFilter(): string {
    return this.M.parentFilter;
  }

  get rSTag(): string {
    return this.M.rSTag;
  }

  get rSTag2(): string {
    return this.M.rSTag2;
  }

  get userCat(): string {
    return this.M.userCat;
  }

  get userTag(): string {
    return this.M.userTag;
  }

  get userTag2(): string {
    return this.M.userTag2;
  }

  get userTag3(): string {
    return this.M.userTag3;
  }

  get userTag4(): string {
    return this.M.userTag4;
  }

  get array(): boolean {
    return this.M.array != null ? this.M.array : true;
  }

  get cls(): string {
    return 'PSSubSysServiceAPIDERSImpl';
  }

  instanceof(cls: string): boolean {
    if (cls == 'service.IPSSubSysServiceAPIDERS') return true;
    return super.instanceof(cls);
  }
}
